﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<skags.Models.addTimelineViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	AddToTimeline
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="navigation">
<% Html.RenderPartial("IndexNavigation"); %>
</div>
<div id="content">
    <% using (Html.BeginForm()) 
      {%>
        <%: Html.ValidationSummary(true) %>

        <fieldset>
            <legend>Nýtt á tímalínu</legend>

                 <div class="editor-label">
                    <label for="ChildID">Veldu barn:</label>
                 </div>
                 <div class="editor-field">
                    <select name="ChildID">
                    <%  foreach (var s in Model.Children)
                        {   %>    
                            <option value="<%= s.ID %>"><%: s.Name%></option>                 
                    <%  }   %>
                     </select>
                    <%: Html.ValidationMessageFor(model => model.ChildID)%>
                </div>
            
                <div class="editor-label">
                   <label for="LineDate">Dagsetning:</label>
                   
                </div>
                <div class="editor-field">
                    <% Model.LineDate = DateTime.Now; %>
                    <%:Html.TextBoxFor(model => model.LineDate)%>
                    <%: Html.ValidationMessageFor(model => model.LineDate)%>
                </div>
                <script type="text/javascript">
                    $(function () {
                        $.datepicker.setDefaults($.datepicker.regional['is']);
                        $.datepicker.setDefaults({ dateFormat: 'dd/mm/yy' });
                        $("#LineDate").datepicker({ changeYear: true });
                        $("#LineDate").datepicker();
                    });
                </script>
            
                <div class="editor-label">
                    <label for="OtherInfo">Atburður:</label>
                </div>
                <div class="editor-field">
                    <%: Html.TextAreaFor(model => model.OtherInfo)%>
                    <%: Html.ValidationMessageFor(model => model.OtherInfo)%>
                </div>
           
                
            <p>
                <input type="submit" value="Skrá" />
            </p>
        </fieldset>

    <% } %>
</div>
</asp:Content>

